package android.ijiajiao.server.impl;

import java.util.ArrayList;

import android.ijiajiao.dao.impl.ContractDaoImpl;
import android.ijiajiao.server.ContractServer;
import net.sf.json.JSONObject;

public class ContractServerImpl implements ContractServer {

	@Override
	public JSONObject contractList(String name) {
		JSONObject data = new JSONObject();
		ArrayList<Object> responsedata = new ContractDaoImpl().contractList(name);
		if (responsedata.isEmpty()) {
			data.put("result", 0);
			data.put("data", "请求失败");
		} else {
			data.put("result", 1);
			data.put("data", responsedata);
		}
		return data;
	}

	@Override
	public JSONObject contract(String name, int contract_id) {
		// TODO Auto-generated method stub
		return null;
	}

}
